package com.study.d5_io2;

import java.io.FileReader;
import java.io.Reader;

public class FileReaderDemo1 {
    public static void main(String[] args) throws Exception{
        //目标：文件字符输入流使用

        Reader re = new FileReader("day10/src/dlei.txt");
        //读取一个字符编号回来，没有就-1
/*        int read = re.read();
        System.out.println((char)read);
        int read1 = re.read();
        System.out.println((char)read1);*/

        //使用循环解决
        int c;
        while((c=re.read())!=-1){
            char c1 = (char)c;
            System.out.print(c1);
        }
        re.close();
    }
}
